<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=script, initial-scale=1.0">
  <title>获取dom节点</title>
</head>


<body>
  <div id="fa">
    <h1>h1ca</h1>
    <p id="p1">id p1
    </p>
    <p class="p26">class p2</p>
  </div>
  <!-- <dl id="app">
    <dt>java</dt>
    <dt>html</dt>
    <dt>jsjs</dt>
  </dl> -->
</body>
<script>
  // 标签选择器 获取dom节点,单引号里面放标签
  var ha = document.getElementsByTagName('h1')
  // class类选择器,单引号里面放class的名字
  var pp = document.getElementsByClassName('p26')
  // id选择器
  var idd = document.getElementById('p1')
  var ide = document.getElementById('fa')
  // 获取所有节点
  var chi = ide.children
  ide.firstChild
  ide.lastChild
  // var d12 = document.getElementById('app')
  // d12.style.color = "green"
</script>


</html>